//水印查看或审核.js

function cancle(){
	var index = parent.layer.getFrameIndex(window.name);
	parent.layer.close(index);
}

function auditSuccess(){
	var remark =$.trim($("#remark").val());
	if(remark == '') {
		layer.alert("审核意见为必填项");
		return false;
	}
	layer.confirm("确定审核通过？",function(){
		layer.closeAll('dialog');
		var layer_load_window = layer.load(2); 
		$("#audit_form").ajaxSubmit({
			type:"post",
			url:path+"/product_water_mark/audit_result?result=1",
			success:function(data){
				var resultArr = data.split(",");
				if(resultArr[0]=="success"){
					layer.msg('操作成功!',{icon:1,time:1000},function(){
						var index = parent.layer.getFrameIndex(window.name);
						parent.$("#search_form").submit();
						parent.layer.close(index);
					});
				}else{
		   			layer.alert("审核失败，" + resultArr[1]);
		   		}
			},
			error:function(data){
				layer.alert("操作失败!");
			},complete: function(XMLHttpRequest, textStatus) {
				layer.close(layer_load_window);
			}
		});
		
	});
}
function auditFail(){
	var remark =$.trim($("#remark").val());
	if(remark == '') {
		layer.alert("审核意见为必填项");
		return false;
	}
	layer.confirm("确定审核驳回？",function(){
		layer.closeAll('dialog');
		var layer_load_window = layer.load(2); 
		$("#audit_form").ajaxSubmit({
			type:"post",
			url:path+"/product_water_mark/audit_result?result=2",
			success:function(data){
				var resultArr = data.split(",");
				if(resultArr[0]=="success"){
					layer.msg('操作成功!',{icon:1,time:1000},function(){
						var index = parent.layer.getFrameIndex(window.name);
						parent.$("#search_form").submit();
						parent.layer.close(index);
					});
				}else{
		   			layer.alert("审核失败，" + resultArr[1]);
		   		}
			},
			error:function(data){
				layer.alert("操作失败!");
			},complete: function(XMLHttpRequest, textStatus) {
				layer.close(layer_load_window);
			}
		});
		
	});
}